﻿//Install Visual T4 for syntax highlighting!
//http://visualstudiogallery.msdn.microsoft.com/40a887aa-f3be-40ec-a85d-37044b239591



using System;

namespace Sponsorship.Domain.Memberships
{
		
    public sealed class EnterMembership : ICommand
    {
        public Guid MembershipId { get; private set; }
        public Guid MembershipTypeId { get; private set; }
        public Guid PersonId { get; private set; }
        public Guid SponsorId { get; private set; }
        public decimal Amount { get; private set; }
        public Nullable<DateTime> StartDate { get; private set; }
        public Nullable<DateTime> EndDate { get; private set; }
        public Period Period { get; private set; }
        public string Comment { get; private set; }
        
        public EnterMembership () {}
        public EnterMembership (Guid membershipId, Guid membershipTypeId, Guid personId, Guid sponsorId, decimal amount, Nullable<DateTime> startDate, Nullable<DateTime> endDate, Period period, string comment)
        {
            MembershipId = membershipId;
            MembershipTypeId = membershipTypeId;
            PersonId = personId;
            SponsorId = sponsorId;
            Amount = amount;
            StartDate = startDate;
            EndDate = endDate;
            Period = period;
            Comment = comment;
        }
    }
    
    public sealed class MembershipEntered : Event
    {
        public Guid MembershipId { get; private set; }
        public Guid MembershipTypeId { get; private set; }
        public Guid PersonId { get; private set; }
        public Guid SponsorId { get; private set; }
        public decimal Amount { get; private set; }
        public Nullable<DateTime> StartDate { get; private set; }
        public Nullable<DateTime> EndDate { get; private set; }
        public Period Period { get; private set; }
        public string Comment { get; private set; }
        
        public MembershipEntered () {}
        public MembershipEntered (Guid membershipId, Guid membershipTypeId, Guid personId, Guid sponsorId, decimal amount, Nullable<DateTime> startDate, Nullable<DateTime> endDate, Period period, string comment)
        {
            MembershipId = membershipId;
            MembershipTypeId = membershipTypeId;
            PersonId = personId;
            SponsorId = sponsorId;
            Amount = amount;
            StartDate = startDate;
            EndDate = endDate;
            Period = period;
            Comment = comment;
        }
    }
    
    public sealed class ChangeMembership : ICommand
    {
        public Guid MembershipId { get; private set; }
        public int Version { get; private set; }
        public Guid MembershipTypeId { get; private set; }
        public Guid PersonId { get; private set; }
        public Guid SponsorId { get; private set; }
        public decimal Amount { get; private set; }
        public Nullable<DateTime> StartDate { get; private set; }
        public Nullable<DateTime> EndDate { get; private set; }
        public Period Period { get; private set; }
        public string Comment { get; private set; }
        
        public ChangeMembership () {}
        public ChangeMembership (Guid membershipId, int version, Guid membershipTypeId, Guid personId, Guid sponsorId, decimal amount, Nullable<DateTime> startDate, Nullable<DateTime> endDate, Period period, string comment)
        {
            MembershipId = membershipId;
            Version = version;
            MembershipTypeId = membershipTypeId;
            PersonId = personId;
            SponsorId = sponsorId;
            Amount = amount;
            StartDate = startDate;
            EndDate = endDate;
            Period = period;
            Comment = comment;
        }
    }
    
    public sealed class MembershipChanged : Event
    {
        public Guid MembershipId { get; private set; }
        public Guid MembershipTypeId { get; private set; }
        public Guid PersonId { get; private set; }
        public Guid SponsorId { get; private set; }
        public decimal Amount { get; private set; }
        public Nullable<DateTime> StartDate { get; private set; }
        public Nullable<DateTime> EndDate { get; private set; }
        public Period Period { get; private set; }
        public string Comment { get; private set; }
        
        public MembershipChanged () {}
        public MembershipChanged (Guid membershipId, Guid membershipTypeId, Guid personId, Guid sponsorId, decimal amount, Nullable<DateTime> startDate, Nullable<DateTime> endDate, Period period, string comment)
        {
            MembershipId = membershipId;
            MembershipTypeId = membershipTypeId;
            PersonId = personId;
            SponsorId = sponsorId;
            Amount = amount;
            StartDate = startDate;
            EndDate = endDate;
            Period = period;
            Comment = comment;
        }
    }
    
    public sealed class DeleteMembership : ICommand
    {
        public Guid MembershipId { get; private set; }
        public int Version { get; private set; }
        
        public DeleteMembership () {}
        public DeleteMembership (Guid membershipId, int version)
        {
            MembershipId = membershipId;
            Version = version;
        }
    }
    
    public sealed class MembershipDeleted : Event
    {
        public Guid MembershipId { get; private set; }
        
        public MembershipDeleted () {}
        public MembershipDeleted (Guid membershipId)
        {
            MembershipId = membershipId;
        }
    }

}